#include "Comm.hpp"

int main()
{
    //1. 获取key
    key_t key = GetKey();
    // std::cout << key << std::endl;

    //2. 获取shm
    int shmid = GetShm(key, shmStandardSize, ClientFlag);

    //3.attach到内存中
    char* addr = (char*)ShmAttach(shmid);

    //读写操作
    Sync sy;
    sy.Read();
    while(sy.Wait())
    {
        std::cout << "addr : " << addr << std::endl;
    }

    //4.detach
    ShmDetach(addr);

    return 0;
}